static void
render_para (GtkTextRenderer *text_renderer,
GtkTextLineDisplay *line_display,
- /* Top-left corner of paragraph including all margins */
- int x,
- int y,
int selection_start_index,
int selection_end_index)
{
/* Selection is the height of the line, plus top/bottom
* margin if we're the first/last line
*/
- selection_y = y + PANGO_PIXELS (first_y) + line_display->top_margin;
+ selection_y = PANGO_PIXELS (first_y) + line_display->top_margin;
selection_height = PANGO_PIXELS (last_y) - PANGO_PIXELS (first_y);
if (first)
cairo_save (cr);
gdk_cairo_set_source_rgba (cr, &selection);
cairo_rectangle (cr,
- x + line_display->left_margin, selection_y,
+ line_display->left_margin, selection_y,
screen_width, selection_height);
cairo_fill (cr);
cairo_restore(cr);
text_renderer_set_state (text_renderer, SELECTED);
pango_renderer_draw_layout_line (PANGO_RENDERER (text_renderer),
line,
- PANGO_SCALE * x + line_rect.x,
- PANGO_SCALE * y + baseline);
+ line_rect.x,
+ baseline);
}
else
{
gdk_cairo_set_source_color (cr, line_display->pg_bg_color);
cairo_rectangle (cr,
- x + line_display->left_margin, selection_y,
+ line_display->left_margin, selection_y,
screen_width, selection_height);
cairo_fill (cr);
text_renderer_set_state (text_renderer, NORMAL);
pango_renderer_draw_layout_line (PANGO_RENDERER (text_renderer),
line,
- PANGO_SCALE * x + line_rect.x,
- PANGO_SCALE * y + baseline);
+ line_rect.x,
+ baseline);
/* Check if some part of the line is selected; the newline
* that is after line->length for the last line of the
{
cairo_t *cr = text_renderer->cr;
cairo_region_t *clip_region = get_selected_clip (text_renderer, layout, line,
- x + line_display->x_offset,
+ line_display->x_offset,
selection_y,
selection_height,
selection_start_index, selection_end_index);
gdk_cairo_set_source_rgba (cr, &selection);
cairo_rectangle (cr,
- x + PANGO_PIXELS (line_rect.x),
+ PANGO_PIXELS (line_rect.x),
selection_y,
PANGO_PIXELS (line_rect.width),
selection_height);
text_renderer_set_state (text_renderer, SELECTED);
pango_renderer_draw_layout_line (PANGO_RENDERER (text_renderer),
line,
- PANGO_SCALE * x + line_rect.x,
- PANGO_SCALE * y + baseline);
+ line_rect.x,
+ baseline);
cairo_restore (cr);
gdk_cairo_set_source_rgba (cr, &selection);
cairo_rectangle (cr,
- x + line_display->left_margin,
+ line_display->left_margin,
selection_y,
PANGO_PIXELS (line_rect.x) - line_display->left_margin,
selection_height);
gdk_cairo_set_source_rgba (cr, &selection);
cairo_rectangle (cr,
- x + PANGO_PIXELS (line_rect.x) + PANGO_PIXELS (line_rect.width),
+ PANGO_PIXELS (line_rect.x) + PANGO_PIXELS (line_rect.width),
selection_y,
nonlayout_width,
selection_height);
* (normally white on black) */
_gtk_style_context_get_cursor_color (context, &cursor_color, NULL);
- cursor_rect.x = x + line_display->x_offset + line_display->block_cursor.x;
- cursor_rect.y = y + line_display->block_cursor.y + line_display->top_margin;
+ cursor_rect.x = line_display->x_offset + line_display->block_cursor.x;
+ cursor_rect.y = line_display->block_cursor.y + line_display->top_margin;
cursor_rect.width = line_display->block_cursor.width;
cursor_rect.height = line_display->block_cursor.height;
pango_renderer_draw_layout_line (PANGO_RENDERER (text_renderer),
line,
- PANGO_SCALE * x + line_rect.x,
- PANGO_SCALE * y + baseline);
+ line_rect.x,
+ baseline);
}
cairo_restore (cr);
}
render_para (text_renderer, line_display,
- 0, 0,
selection_start_index, selection_end_index);
/* We paint the cursors last, because they overlap another chunk